<?php


class ArrayProcessor_ArrayProcessor  {

	public static function replaceValue ($array, $replacer, $needle)  {
		
		$replacedArray = array();
		
		foreach ($array as $key=>$data)  {
			if (is_array($data) && !is_string($data))  {
				$replacedArray[$key] = self::replaceValue($data, $replacer, $needle);
			}
			else  {
				if ($key = (array_search($needle, $array)))  {
					$array[$key] = $replacer;
					$replacedArray = $array;
				}
				else  {
					$replacedArray = $array;
				}
			}
			
			
		}
		
		return $replacedArray;
		
	}
	
}